package com.example.mvvmkotlin.mvvm

import android.util.Log
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleObserver
import androidx.lifecycle.OnLifecycleEvent

/**
 * @ProjectName : MvvmKotlin
 * @Author : FangMu
 * @Time : 2023/11/22 13:42
 * @Description : 文件描述
 */
class MainObserver: LifecycleObserver {
    @OnLifecycleEvent(Lifecycle.Event.ON_CREATE)
    fun onCreate() {
        Log.d("TAG", "onCreate: LifecycleObserver监听onCreate")
    }

    @OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
    fun onDestroy() {
        Log.d("TAG", "onDestroy: LifecycleObserver监听onDestroy")
    }
}